package com.test.javafaq_portal.vo;

import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Data
public class RegisterVo implements Serializable {

    @NotBlank(message = "邀请码不能为空")   //针对字符串类型不能为null也不能为""
    private String inviteCode;

    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^1\\d{10}$" ,message = "手机号不正确")
    private String phone;

    @NotBlank(message = "昵称不能为空")
    @Pattern(regexp = "^.{2,20}$" ,message = "昵称长度是2到20个字符")
    private String nickname;

    @NotBlank(message = "密码不能为空")
    @Pattern(regexp = "^\\w{6,20}$" ,message = "密码是6到20位字母，数字，_组成")
    private String password;

    @NotBlank(message = "确认密码不能为空")
    private String  confirm;
}
